#!/bin/bash

if [ 'adminapi' == "$2" ];then
    pos="adminapi-lvs.access.log"
elif [ 'admin' = "$2" ];then
    pos="admin-lvs.access.log"
elif [ 'app' == "$2" ];then
    pos="app-lvs.access.log"
elif [ 'web' == "$2" ];then
    pos="web-lvs.access.log"
else
    pos=0
fi

A=`date | awk '{print $3,$2,$6}' | sed 's# #/#g'`
B=`date | awk '{print $4}' | awk -F":"  '{print $1,$2,$3}'  | sed 's# #:#g'`
sudo cat /home/log/nginx/"$1"/${pos}   | grep "$A":"$B"   | wc -l
